<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>WELCOME TO FILE MANAGER!!!</title>
</head>
<body>
<%@ page import="file_functions.*, java.util.Vector" %>
<%!Manager man = new Manager(null);%>
Choose directory for displacing selected files
<br>

<%
if (request.getParameter("file") != null)
	man.cd_command(new String(request.getParameter("file").getBytes("ISO-8859-1"), "UTF8"));
else if (session.getAttribute("dir") != null)
	man.set_dir(new String((byte[])session.getAttribute("dir"), "UTF8"));
	
	

Vector<Files_info> result = man.ls_command(false, true, 1, 0, 0);
session.setAttribute("displace", man.get_name().getBytes("UTF8"));
%>
<%= man.get_name() %>
<br>
<form ACTION="Displace_main.jsp" METHOD=POST>
<INPUT TYPE = "submit" VALUE = "Choose this directory" NAME = "button">
</form>
<TABLE cellspacing = "15">
<TR>
<TH>Name</TH>
<TH>Size</TH>
<TH>Last modify date</TH>
<TH></TH>
</TR>
<% for (int i = 0; i < result.size(); i++)
{ 
%>
<TR>
 <TD> <a href = "?file=<%= result.get(i).name %>"><%= result.get(i).name %></a></TD>
 <TD> <%= result.get(i).size %></TD>
 <TD> <%= result.get(i).date %></TD>
</TR>
<% } %>
</TABLE>

</body>
</html>